{% extends 'base.html' %}
{% load staticfiles %}
{% load skill_tag %}
{% load resume_tags %}
{% load category_tag %}
{% block left %}

    <div class="box">
        <h3 class="clearfix" style="text-align: center;">
            <span style="color: #3A8FB7;">共找到{% get_resume_num %}个人才</span>
        </h3>
    </div>

    <div class="box category">
        <h3>人才类型</h3>
        <div class="content">
            {% get_category_tag as categorys %}

            {% for foo in categorys %}
                <a href="{% url 'recommendation:category' foo.content %}">
                    <span class="tag">
                        <i class="fa fa-{% get_category_awesome foo.content %} fa-lg"
                           aria-hidden="true"></i>{{ foo.content }}</span>
                </a>
            {% endfor %}

        </div>
    </div>

    <div class="box">
        <h3 class="clearfix">技能标签<span style="float: right;">更多</span></h3>
        <div class="content">
            {% get_skill_tag as tag_list %}
            {% for skill in tag_list %}
                <a href="{% url 'recommendation:skill' skill.name %}"><span class="label ">{{ skill.name }}</span></a>
            {% endfor %}
        </div>
    </div>

{% endblock %}

{% block main %}
    <div class="box search">
        <div class="search-left"><input id="search_text" placeholder="搜索你感兴趣的人才"></div>
        <div class="search-right" id="search"><span>搜索</span></div>
    </div>

    {% if resume_list.count < 1 %}
                    <div class="box resume">
            <div class="content">
                <dl class="clearfix">
                    暂无人才信息
                </dl>
            </div>
        </div>
    {% endif %}
    {% for resume in resume_list %}
        <div class="box resume">
            <div class="content">
                <dl class="clearfix">
                    <dt class="clearfix pull-left">
                        <p class="paper-image">
                            <a class="paper-title" href="{{ resume.get_absolute_url }}">
                                <img class="user-img" src="{{ resume.author.avatar.url }}">
                                <span class="txb">{{ resume.title }}</span>
                            </a>
                            <span>{{ resume.category }}</span>
                        </p>
                    </dt>
                    <dd>
                        <span class="like-num">{{ resume.total_like }}</span>
                        <span class="like-img">
                            <i class="icon icon-thumbs-up"></i>
                        </span>
                        <span class="recommand">{{ resume.author }}</span>

                    </dd>
                    <div class="bottom clearfix">
                        <p>
                            {{ resume.get_summary }}
                        </p>
                    </div>
                    <div class="skill">
                        <span>技能树：</span>
                        {% for tag in resume.skill.all %}
                            <span class="label label-warning">{{ tag.name }}</span>
                        {% endfor %}
                    </div>
                    <div class="compress">
                        <span>印象海：</span>
                        {% get_lab_list resume.id as lab_list %}
                         {% for foo in lab_list %}
                            <span class="label  label-primary">{{ foo.content }}</span>
                        {% endfor %}
                    </div>
                </dl>
            </div>
        </div>
    {% endfor %}

    <ul class="pager" data-ride="pager" data-page="{{ page_obj.number }}" data-link-creator="?page={page}"
        data-rec-per-page="4" data-rec-total="{{ paginator.count }}" data-max-nav-count="4"
        data-elements="prev,nav,next"></ul>
{% endblock %}

{% block domready %}
    <script>
        $(function () {

            $('#search').bind("click", function () {
                window.location.href = "{% url 'haystack_search' %}?q="+$('#search_text').val();
            });


        });


    </script>

{% endblock %}

<!-- jQuery (ZUI中的Javascript组件依赖于jQuery) -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<!-- ZUI Javascript组件 -->
<script src="https://cdn.bootcss.com/zui/1.8.1/js/zui.min.js"></script>
</body>
</html>